package src;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

public class Parser {

public static ArrayList<String> nomes() throws IOException{

    File file = new File("nomes.txt");
    ArrayList<String> ret = new ArrayList <String> ();
    int total = 1;
    String line = null;
    BufferedReader br = new BufferedReader(new FileReader(file));

    while((line = br.readLine())!=null){
        total ++;
        ret.add(line);

    }

    br.close();
    return ret;



}
public static ArrayList<String> apelidos() throws FileNotFoundException, IOException{

    File file = new File("sobrenomes.txt");
    ArrayList<String> ret = new ArrayList <String> ();
    int total = 1;
    String line = null;
    BufferedReader br = new BufferedReader(new FileReader(file));

    while((line = br.readLine())!=null){
        ret.add(line);

    }

    br.close();
    return ret;



}


public static void main(String[] args) throws FileNotFoundException, IOException {

    ArrayList<String> ret = new ArrayList <String> ();
    ret = nomes();
    System.out.println(ret.toString());
    System.out.println(ret.size());

}
}